import java.util.Arrays;
import java.util.Scanner;

public class Leetcode_4 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        System.out.println("请输入有几位数：");
        int a = s.nextInt();
        int[] arr = new int[a];
        for (int i = 0; i < a; i++) {
            System.out.println("请输入第" + (i + 1) + "位数：");
            arr[i] = s.nextInt();
        }
        arr[a - 1] = arr[a - 1] + 1;
        int sum = 0;
        for (int j = 0; j < a ; j++) {
            sum = sum * 10 + arr[j];
        }
        System.out.println("加一后为："+sum);
    }
}
